package com.kun.annotation;


import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

//测试自定义注解
public class DiyAnnotation {

    @MyAnnotation_1("test")
    @MyAnnotation_2(hobbies = {"reading", "swimming"})
    public void test() {

    }




}

@Target({ElementType.TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@interface MyAnnotation_1 {
    String value() default "default value";
}

@Target({ElementType.TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@interface MyAnnotation_2 {
    String name() default "default name";
    int age() default 18;
    String[] hobbies();
}